/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gtracker;

import java.util.Vector;

/**
 *
 * @author sv
 */
public class UserInfo {

	public Vector<Integer> getGidList() {
		return gidList;
	}

	public byte[] getNodeID() {
		return nodeID;
	}

	public String getPubKey() {
		return pubKey;
	}

	public String getIP() {
		return ipAddress;
	}

	public UserInfo(String ip, String pubKey, byte[] nodeID) {
		ipAddress = ip;
		this.pubKey = pubKey;
		this.nodeID = nodeID;
		gidList = new Vector<Integer>();
	}

	public void addGroup(Integer gid) {
		synchronized(this) {
			gidList.add(gid);
		}
	}

	public void removeGroup(Integer gid) {
		synchronized(this) {
			gidList.remove(gid);
		}
	}
	protected String ipAddress,  pubKey;
	protected byte[] nodeID;
	protected Vector<Integer> gidList;
}
